package com.gaofei;

import com.gaofei.loans.LoansApp;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = LoansApp.class)
@RunWith(SpringRunner.class)
public class ProcessDeploy {

    @Autowired
    RepositoryService repositoryService;

    @Test
    public void deploy(){
        Deployment deployment = repositoryService.createDeployment()
                .name("贷款审批流程")
                .addClasspathResource("process/loans.bpmn20.xml")
                .addClasspathResource("process/loans.png")
                .deploy();

        String id = deployment.getId();
        String name = deployment.getName();
        System.out.println(id+"====="+name);
    }
}
